<?php

namespace App\Kuafu\Mybank\Model;

use App\Kuafu\Base\Model\BaseModel;
use App\Kuafu\Base\Model\Traits\KfSoftDeletes;
use App\Kuafu\Base\Model\Traits\KfUid;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class MybankFuyouBillRecordModel extends BaseModel
{
    protected $table = "mybank_fuyou_bill_record";

    use HasFactory, KfSoftDeletes;

    protected $fillable = [
        'id',
        'shopId',
        'mybankMerchantId',
        'kfOrderNo',
        'fyMerchantId',
        'cardNum',
        'cardAttr',
        'referenceNum',
        'transactionType',
        'terminalNum',
        'merchantOrderNo',
        'channelOrderNo',
        'mybankOrderNo',
        'transactionAmount',
        'transactionStatus',
        'transactionStatusDesc',
        'transactionCompletionTime',
        'transactionDate',
        'originalTransactionOrderNo',
        'transactionFee',
        'externalOrderNo',
        'transactionCode',
        'isPreferentialRate',
        'merchantDiscountRate',
        'errorTransactionSign',
        'remark',
        'createdAt',
        'updatedAt',
        'isDeleted',
    ];

    public function originalTransactionRel()
    {
        return $this->hasMany(self::class, 'originalTransactionOrderNo', 'merchantOrderNo');
    }

}
